<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.lmpop.trade.ti_admin.*" %>
<%@ page import="com.lmpop.trade.ti_organize.*" %>
<%@ page import="com.lmpop.trade.ts_role.*" %>
<%@ page import="java.util.*" %>
<% 
		String g_cust_id = "";	
		if( session.getAttribute("session_cust_id") != null ){
			g_cust_id = session.getAttribute("session_cust_id").toString();
		}
		Ti_organizeInfo ti_organize = new Ti_organizeInfo();
		String orgSelect  = ti_organize.getOrganizeByUpIdSelect(g_cust_id,"000000000000000");  
		
		Ts_roleInfo ts_roleInfo = new Ts_roleInfo();
		List rolelist = ts_roleInfo.getListByPk(g_cust_id);
  	
  	String user_id = "";
  	if(request.getParameter("user_id")!=null) 
  		user_id = request.getParameter("user_id");
  		
  	Ti_adminInfo ti_adminInfo = new Ti_adminInfo();
  	List list = ti_adminInfo.getListByPk(user_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) 
  		map = (Hashtable)list.get(0);
	  	String user_name="",passwd="",cust_id="",real_name="",phone="",email="",
	  	cellphone="",fax="",qq="",msn="",user_state="",user_type="",org_id="",org_id_value="",
	  	role_code_="",passwd_ques="",passwd_answer="",oper_date="",staff_id="",remark="";
	  	if(map.get("user_name")!=null) user_name = map.get("user_name").toString();
	  	if(map.get("passwd")!=null) passwd = map.get("passwd").toString();
	  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
	  	if(map.get("real_name")!=null) real_name = map.get("real_name").toString();
	  	if(map.get("phone")!=null) phone = map.get("phone").toString();
	  	if(map.get("email")!=null) email = map.get("email").toString();
	  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
	  	if(map.get("fax")!=null) fax = map.get("fax").toString();
	  	if(map.get("qq")!=null) qq = map.get("qq").toString();
	  	if(map.get("msn")!=null) msn = map.get("msn").toString();
	  	if(map.get("role_code") != null) {
	  		role_code_ = map.get("role_code").toString();
	  	}
	  	if(map.get("org_id") != null) {
				org_id = map.get("org_id").toString();
				String org_id_str[] = org_id.split("\\|");
				if(!org_id.equals("")){
					for(int k = 0;k < org_id_str.length;k++){
						org_id_value += ti_organize.getOrgNameById(org_id_str[k]) + "&nbsp;";
					}
				}
			}
	  	if(map.get("passwd_ques")!=null) passwd_ques = map.get("passwd_ques").toString();
	  	if(map.get("passwd_answer")!=null) passwd_answer = map.get("passwd_answer").toString();
	  	if(map.get("remark")!=null) remark = map.get("remark").toString();
		
	
	String u_name = "";
	if(request.getParameter("u_name")!=null && !request.getParameter("u_name").equals("")){
		u_name = request.getParameter("u_name");
	}
	String r_name = "";
	if(request.getParameter("r_name")!=null && !request.getParameter("r_name").equals("")){
		r_name = request.getParameter("r_name");
	}
	String role = "";
	if(request.getParameter("role")!=null && !request.getParameter("role").equals("")){
		role = request.getParameter("role");
	}
	String org = "";
	if(request.getParameter("org")!=null && !request.getParameter("org").equals("")){
		org = request.getParameter("org");
	}
	String state = "";
	if(request.getParameter("state")!=null && !request.getParameter("state").equals("")){
		state = request.getParameter("state");
	}
	String iStart = "0";
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	String para = "/program/admin/admin/index.jsp?u_name="+u_name+
	"&r_name="+r_name+"&role="+role+"&org="+org+"&state="+state+"&iStart="+Integer.parseInt(iStart);
%>
<html>
  <head>
    
    <title>修改管理员资料</title>
		<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
		<script type='text/javascript' src='/dwr/interface/Ti_organizeInfo.js'></script>
		<script type='text/javascript' src='/dwr/interface/Ti_adminInfo.js'></script>
		<script type='text/javascript' src='/dwr/engine.js'></script>
		<script type='text/javascript' src='/dwr/util.js'></script>
		<script type="text/javascript" src="admin.js" charset="UTF-8"></script>
		<script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
</head>

<body>

  
	
	<h1>修改管理员资料</h1>
	<!--table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>您可以按“行业”或“关键字”订阅</h4>
		  <span>1、填写关键字，您将及时了解与该产品相关的所有商机。</span><br/>
		  <span>2、为了更准确订阅，建议你选择产品所属的行业大类和行业子类。</span>
		  </td>
        </tr>
      </table-->
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="15%">
				用户名<font color="red">*</font>
			</td>
			<td><%=user_name%></td>
			<td align="right" width="15%">
				真实姓名<font color="red">*</font>
			</td>
			<td><input name="real_name" id="real_name" type="text" maxlength="20" value="<%=real_name%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				部门<font color="red">*</font>
			</td>
			
			<td colspan="3">
				<div id="org1">
					<font color="#CECECE"><%=org_id_value%></font>
					<input type="button" name="buttons" value="修改部门" class="buttoncss" onclick="ChangeOrg()" />
				</div>
				<div style="display:none;" id="org2">
					<select name="sort1" id="sort1" onChange="setSecondClass(this.value);" >
	          			<option value="">请选择</option>
	          			<%=orgSelect%>
	        		</select>  
	        		<select name="sort2" id="sort2"  onChange="setTherdClass(this.value);" style="display:none;">
						<option value="">请选择</option>
					</select> 
					<select name="sort3" id="sort3" style="display:none;" >
						<option value="">请选择</option>
					</select> 
					<input name="org_id" id="org_id" type="hidden" value="<%=org_id%>" />
				</div>
			</td>
			
			
		</tr>
		
		<tr>
			<td align="right" width="15%">
				角色<font color="red">*</font>
			</td>
			<td colspan="3">
				<%
					int size = 0;
					if (rolelist != null && rolelist.size() > 0) {
						Hashtable maps = new Hashtable();
						size = rolelist.size();
						for (int i = 0; i < rolelist.size(); i++) {
							maps = (Hashtable) rolelist.get(i);
							String role_code = "",role_name = "";
							if (maps.get("role_code") != null) {
								role_code = maps.get("role_code").toString();
							}
							if (maps.get("role_name") != null) {
								role_name = maps.get("role_name").toString();
							}
				%>
				<input name="role_code<%=i%>" id="role_code<%=i%>" <%if(role_code_.indexOf(role_code)>=0){%>checked="checked"<%}%> value="<%=role_code%>" type="checkbox" /><%=role_name%>
				<%
						}
					}
				%>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				密码提示问题:
			</td>
			<td><input name="passwd_ques" id="passwd_ques" type="text" maxlength="50" value="<%=passwd_ques%>" onBlur="this.value=trim(this.value);" /></td>
			<td align="right" width="15%">
				密码提示答案:
			</td>
			<td><input name="passwd_answer" id="passwd_answer" type="text" maxlength="50" value="<%=passwd_answer%>" onBlur="this.value=trim(this.value);" /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				电话:
			</td>
			<td><input name="phone" id="phone" type="text" maxlength="20" value="<%=phone%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
			<td align="right" width="15%">
				邮箱:
			</td>
			<td><input name="email" id="email" type="text" maxlength="30" value="<%=email%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
		</tr>
	
		<tr>
			<td align="right" width="15%">
				手机:
			</td>
			<td><input name="cellphone" id="cellphone" type="text" maxlength="20" value="<%=cellphone%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
			<td align="right" width="15%">
				传真:
			</td>
			<td><input name="fax" id="fax" type="text" maxlength="20" value="<%=fax%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				QQ:
			</td>
			<td><input name="qq" id="qq" type="text" maxlength="15" value="<%=qq%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
			<td align="right" width="15%">
				MSN:
			</td>
			<td><input name="msn" id="msn" type="text" maxlength="30" value="<%=msn%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				备注:
			</td>
			<td colspan="3"><input name="remark" id="remark" type="text" maxlength="25" size="40" value="<%=remark%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); " /></td>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>" />
				<input type="hidden" name="linkSize" value="<%=size%>" id="linkSize" />
				<input name="role_code" id="role_code" type="hidden" value="" />
				<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>" />
				<input type="hidden" name="bpm_id" value="0407" />
				<input type="hidden" name="jumpurl" value="<%=para%>" />
				<input class="buttoncss" type="button" name="Submit2" id="Submit2" value="提交" onclick="submitValues()" />&nbsp;&nbsp;
				<input class="buttoncss" type="button" name="tradeRut" value="返回" onclick="window.location.href='<%=para%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
